home *** CD-ROM | disk | FTP | other *** search
/ MacWorld 1999 September (IDG) / Sep99.iso / Shareware World / Comms & Internet / LinkConverter 1.1.2 / Dialog Director v0.7 / Examples / IconListDemo.as < prev    next >
Encoding:
Text File  |  1998-01-19  |  1.6 KB  |  34 lines  |  [TEXT/ToyS]

  1. property iconList : [200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222]
  2. set textList to []
  3. set fold to (path to control panels folder) as text
  4. set fs to list folder fold
  5. if fs's length > iconList's length then set fs to fs's items 1 thru (iconList's length)
  6. repeat with f in fs
  7.     set i to info for (fold & f)
  8.     tell i to set textList to textList & [name & tab & (modification date's time string) & tab & size]
  9. end repeat
  10.  
  11. set iconListDlog to {size:[500, 306], contents:[¬
  12.     {class:push button, name:"OK", bounds:[418, 276, 490, 296]}, ¬
  13.     {class:push button, name:"Cancel", bounds:[336, 276, 408, 296]}, ¬
  14.     {class:icon list box, contents:iconList, flags:1, bounds:[10, 24, 162, 250], font:5}, ¬
  15.     {class:list box, contents:textList, flags:1, bounds:[180, 24, 490, 250], value:[1, 3, 5], column widths:[150, 80], font:6}, ¬
  16.     {class:group box, bounds:[2, 264, 497, 264]}, ¬
  17.     {class:static text, contents:"Select some here", justification:left, bounds:[10, 4, 180, 20], font:1}, ¬
  18.     {class:static text, contents:"Then select some here", justification:right, bounds:[180, 4, 490, 20], font:1} ¬
  19.         ], name:"Icon List Demo", style:standard window}
  20.  
  21. dd install with fonts [null, null, null, null, {name:"Geneva", size:9}, {name:"Helvetica", size:12, style:condensed, color:[22222, 0, 0]}] with grayscale
  22. --dd auto dialog iconListDlog
  23. set d to dd make dialog iconListDlog
  24. repeat
  25.     set i to dd interact with user
  26.     if i = 3 then
  27.         dd set value of item 4 of d to (dd get value of item 3 of d)
  28.     else if i = 4 then
  29.         dd set value of item 3 of d to (dd get value of item 4 of d)
  30.     else if i ≤ 2 then
  31.         exit repeat
  32.     end if
  33. end repeat
  34. dd uninstall